#ifndef _RENDER_MANAGER_H
#define _RENDER_MANAGER_H

#include "SFML\Graphics.hpp"
#include <memory>

enum RenderState
{
	RS_NONE = 0,
	RS_WINDOW,
	RS_BACKBUFFER
};

enum Views
{
	VIEW_STANDARD = 0,
	VIEW_FRONT
};

class RenderManager
{
public:
	RenderManager(std::shared_ptr<sf::RenderWindow> window, std::shared_ptr<sf::View> view);
	~RenderManager(void);
	void setRenderState(unsigned int renderState);
	void setView(unsigned int view);
	void resetView() { _window->setView(_window->getDefaultView()); }

	void beginRender();
	void draw(sf::Drawable& sprite);
	void draw(sf::Drawable& sprite, sf::Shader& shader);
	void endRender();

private:
	std::shared_ptr<sf::RenderWindow> _window;
	std::shared_ptr<sf::View> _view;
	std::shared_ptr<sf::View> _frontView;
	sf::RenderTexture _renderTexture;
	RenderState _renderState;
};

#endif // _RENDER_MANAGER_H

